using System;
using System.Net;
using System.Web;

namespace OpenWaves.ActivityFeed.Web.Handler
{
    public class HttpHandlerPipelineEventArgs : EventArgs
    {
        private readonly HttpContextBase context;
        public HttpContextBase Context
        {
            get { return this.context; }
        }

        public HttpRequestBase Request
        {
            get { return this.context.Request; }
        }

        public HttpResponseBase Response
        {
            get { return this.context.Response; }
        }

        public bool IsRequestHandled { get; set; }

        public void TerminateRequest(HttpStatusCode statusCode)
        {
            this.Response.StatusCode = (int) statusCode;
            this.IsRequestHandled = true;
        }

        public HttpHandlerPipelineEventArgs(HttpContextBase context)
        {
            this.context = context;
        }
    }
}